#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

void mysys(char *command)
{
    pid_t pid = fork();

    if (pid == 0)
    {
        char* argv[] = {"sh", "-c", command, NULL};
        execvp("/bin/sh", argv);
    }
    else
    {
        wait(NULL);
    }
}

int main()
{
    printf("--------------------------------------------------\n");
    mysys("echo HELLO WORLD");
    printf("--------------------------------------------------\n");
    mysys("ls /");
    printf("--------------------------------------------------\n");
    return 0;
}